<?php
//****店铺类型修改
namespace app\admin\controller;
use think\Db;
use controller\BasicAdmin;
class Adminshoptype extends BasicAdmin{
    public $table = 'shop_type';
    public function index(){
        list($get, $db) = [$this->request->get(), Db::name($this->table)];
        $list = parent::_list($db->order('sort DESC'),1,'','');
        $status = [1=>'正常',0=>'锁定'];

        foreach($list['list'] AS $key=>$value){
            $list['list'][$key]['statusName']  = $status[$value['status']];
        }
        return $this->fetch('', ['title' => '商铺分类列表','list'=>$list]);
    }

    public function add()
    {
        return $this->_form($this->table, 'form');
    }
    public function edit()
    {
        return $this->_form($this->table, 'form');
    }
}